package testIntergration;


import static org.junit.Assert.assertEquals;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import FamilyTherapy.GCWindow;
import FamilyTherapy.Player;

public class testGCWindow_displayPlayerInfo {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	@Test
	public void testDisplayPlayerInfo() {
		GCWindow gwindow = new GCWindow();
		Player p=new Player( "a",1);
		
		
		final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
		System.setOut(new PrintStream(outContent));
		
		String expected = "---------------------------------------------\n" + 
		"a, You are Grandma\n" +
		"You have 5 self esteem points.\n" + "\n" ;
		
		gwindow.displayPlayerInfo(p);
		
		assertEquals(expected,outContent.toString());
	}

}
